package library.http;

import java.util.ArrayList;
import java.util.List;

import okhttp3.OkHttpClient;

/**
 * Created by Mr.Fan on 2017/3/25.
 */

public class HttpAdapter {
    private OkHttpClient mHttpClient;
    private final List<Converter> mConverters = new ArrayList<>();

    public void setHttpClient(OkHttpClient mHttpClient) {
        this.mHttpClient = mHttpClient;
    }

    protected OkHttpClient getHttpClient() {
        return mHttpClient != null ? mHttpClient : new OkHttpClient();
    }

    public void addConverter(Converter converter) {
        if (converter != null)
            this.mConverters.add(converter);
    }

    protected List<Converter> getConverters() {
        return mConverters;
    }

}
